﻿using System;
using System.Linq;
using UnityEditor;
using UnityEngine;

[CustomEditor(typeof(Battle5vs5Center))]
public class Battle5vs5CenterEditor : Editor {

	void OnSceneGUI()
	{
		var inst = target as Battle5vs5Center;
		Handles.BeginGUI();//2d start

		Handles.EndGUI();//2d end

		if(inst==null || inst.positionVec==null)
			return;
		int cid=0;
		for(int line = 0; line<inst.MAXLINE; line++) {
			for(int row = 0; row<inst.MAXROW; row++) {
				if(inst.isOccupied != null && inst.isOccupied[line,row])
					GUI.color = Color.cyan;
				else
					GUI.color = Color.white;
				Handles.CubeCap(cid, inst.positionVec[line,row], Quaternion.identity, 0.2f);
				cid++;
			}
		}
	}
}
